package mesEntites;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;


@Entity
@Table(name = "TELEPHONE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Telephone.findAll", query = "SELECT t FROM Telephone t")})
public class Telephone implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull    
    @Column(name="telephId")
    private Long id;
    @Basic(optional = false)
    @NotNull
    private String num;
    @ManyToOne 
    private Editeur telsEditeurs;
    
    
    
    public Telephone() {
    }

    public Telephone(Long id, String num, Editeur telsEditeurs) {
        this.id = id;
        this.num = num;
        this.telsEditeurs = telsEditeurs;
    }
    
    public Editeur getTelsEditeurs() {
        return telsEditeurs;
    }

    public void setTelsEditeurs(Editeur telsEditeurs) {
        this.telsEditeurs = telsEditeurs;
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Telephone)) {
            return false;
        }
        Telephone other = (Telephone) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mesEntites.Telephone[id=" + id + "]";
    }

}
